package cn.edu.suse.epilepsy.common;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @Author: QingShu
 * @Date: 2024/7/4 15:03
 */
@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(BizException.class)
    public R handleBizException(BizException e){
        return R.failed(e.getMessage());
    }

//    @ExceptionHandler(Exception.class)
//    public R handleException(Exception e){
////        e.printStackTrace();
//        return R.failed("服务器错误");
//    }
}

